// import { createStore } from 'redux';
import { createStore } from '../myredux';
/* 1 创建一个管理员*/
// 管理员：修改store容器的公共状态
let initial = {
  supNum: 10,
  oppNum: 5,
};

const reducer = function reducer(state = initial, action) {
  state = { ...state };
  switch (action.type) {
    case 'VOTE_SUP':
      state.supNum++;
      break;
    case 'VOTE_OPP':
      state.oppNum++;
      break;
    default:
  }
  return state;
};

//创建store公共容器
const store = createStore(reducer);
export default store;
